package com.start_eternity.oasissafewalk.mapper;

import com.start_eternity.oasissafewalk.pojo.SingleOrders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * author:ZhangT
 * Date:2024 / 03 / 30 / 10:48
 * Description:
 */
public interface SingleOrdersMapper {

    //根据个人订单 Id 查询
    @Select("select * from `single_orders` where single_id = #{id}")
    SingleOrders queryById(@Param("id") Integer id);

    //根据个人订单 详细订单 id 查询
    @Select("select * from `single_orders` where order_detail_id = #{dId}")
    SingleOrders queryByDetailsId(@Param("dId") Integer dId);

    //添加递single订单
    @Insert("insert into `single_orders`(order_detail_id,single_status,delivered_time,reason,route_id) " +
            "values (#{orderDetailId},#{singleStatus},#{deliveredTime},#{reason},#{routeId})")
    int insert(SingleOrders singleOrders);

    //更新single 订单 根据singleId
    int updateById(SingleOrders singleOrders);

    //更新single 订单 根据orderDetailId
    int updateBydId(SingleOrders singleOrders);
}
